package com.ytjj.qmyx.mall.enums;

public enum GroupBuyFinalStatusEnums {
    PROCESS(0,"拼团中"),
    FINAL(1, "成团"),
    FAIL(2, "失败")
    ;

    private Integer code;
    private String message;

    GroupBuyFinalStatusEnums(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(Integer code){
        for (GroupBuyFinalStatusEnums value : GroupBuyFinalStatusEnums.values()) {
            if(value.getCode().equals(code)){
                return value.getMessage();
            }
        }
        return null;
    }

    public static Integer getCodeByMessage(String message){
        for (GroupBuyFinalStatusEnums value : GroupBuyFinalStatusEnums.values()) {
            if(value.getMessage().equals(message)){
                return value.getCode();
            }
        }
        return null;
    }
}
